Skip to content

[Lidarr] Port to tidal-dl-ng#401

Open
samhaswon wants to merge 12 commits intoRandomNinjaAtk:mainfrom
samhaswon:main
Open

[Lidarr] Port to tidal-dl-ng#401
samhaswon wants to merge 12 commits intoRandomNinjaAtk:mainfrom
samhaswon:main

Conversation

@samhaswon
Copy link

Since tidal-dl is still broken and tidal-dl-ng works, port the audio downloading script to it.

Fixes #391, #374, #289, and maybe more.

Changes

  • Mostly just find/replace tidal-dl calls for tidal-dl-ng.
  • Moved TIDAL config/auth state under /config/extended/tidal_dl_ng via XDG_CONFIG_HOME and ensured directories exist.
  • Mapped audio/video quality settings to tidal-dl-ng enums and set download_base_path/quality_audio through tidal-dl-ng cfg.
  • Updated the bundled TIDAL config to tidal-dl-ng format and switched setup to install tidal-dl-ng.

Breaks

The port does require some changes to work.

  • The Audio and TidalVideoDownloader services must be updated, of course.
    • This could be fixed by checking file hashes in the setup script.
  • The tidal-dl.json file contents are changed. This could be worked around with a rename if desired. If so, the URL in the setup script will break.

Testing

I haven't tested every possible configuration, but it seems to work with lossless/master for the quality. I've tested artists with a mix of lossless and "Max" with no issues. I also started it on my server, and it is having some upstream issues with existing files.

When testing, I mostly just followed the existing setup directions and then copied over the new Audio and video services (including renaming) and the new tidal config file.

Additionally, I don't personally use the video downloading scripts, but it seems to be working.

Potential Issues

For context, since Lidarr started having issues from the MusicBrainz change, I've mostly been doing things manually. Then tidal-dl broke, and I tried fixing it, then gave up after realizing I was basically rewriting the thing. So, I moved to using tidal-dl-ng.

However, since I started using it, there has apparently been some kind of take-down on the original repo. The PyPi package is still up and working, for now, but the GitHub repo is gone.

For reference, here's the PyPi package: https://pypi.org/project/tidal-dl-ng/
But the GitHub repo is a 404: https://github.com/exislow/tidal-dl-ng

If that's an issue, several forks exist that could be used. I haven't found one on PyPi yet, but they could just be installed from GitHub directly like this:

uv pip install --system --upgrade --no-cache-dir --break-system-packages "git+https://github.com/FunWarry/tidal-dl-ng-For-DJ.git@main"

@tinstep
Copy link

tinstep commented Jan 29, 2026

I get very close, but I have FFMPEG issues with these changes - looks like there is a fix here?mkudrjasevs@ea95270

lidarr  | Traceback (most recent call last):
lidarr  |   File "/usr/bin/tidal-dl-ng", line 4, in <module>
lidarr  |     from tidal_dl_ng.cli import app
lidarr  |   File "/usr/lib/python3.12/site-packages/tidal_dl_ng/cli.py", line 25, in <module>
lidarr  |     from tidal_dl_ng.download import Download
lidarr  |   File "/usr/lib/python3.12/site-packages/tidal_dl_ng/download.py", line 24, in <module>
lidarr  |     from ffmpeg import FFmpeg
lidarr  | ImportError: cannot import name 'FFmpeg' from 'ffmpeg' (/usr/lib/python3.12/site-packages/ffmpeg/__init__.py). Did you mean: '_ffmpeg'?
lidarr  | Traceback (most recent call last):
lidarr  |   File "/usr/bin/tidal-dl-ng", line 4, in <module>
lidarr  |     from tidal_dl_ng.cli import app
lidarr  |   File "/usr/lib/python3.12/site-packages/tidal_dl_ng/cli.py", line 25, in <module>
lidarr  |     from tidal_dl_ng.download import Download
lidarr  |   File "/usr/lib/python3.12/site-packages/tidal_dl_ng/download.py", line 24, in <module>
lidarr  |     from ffmpeg import FFmpeg
lidarr  | ImportError: cannot import name 'FFmpeg' from 'ffmpeg' (/usr/lib/python3.12/site-packages/ffmpeg/__init__.py). Did you mean: '_ffmpeg'?
lidarr  | Traceback (most recent call last):
lidarr  |   File "/usr/bin/tidal-dl-ng", line 4, in <module>
lidarr  |     from tidal_dl_ng.cli import app
lidarr  |   File "/usr/lib/python3.12/site-packages/tidal_dl_ng/cli.py", line 25, in <module>
lidarr  |     from tidal_dl_ng.download import Download
lidarr  |   File "/usr/lib/python3.12/site-packages/tidal_dl_ng/download.py", line 24, in <module>
lidarr  |     from ffmpeg import FFmpeg
lidarr  | ImportError: cannot import name 'FFmpeg' from 'ffmpeg' (/usr/lib/python3.12/site-packages/ffmpeg/__init__.py). Did you mean: '_ffmpeg'?

@samhaswon
Copy link
Author

It might be a simpler fix to just postpone the installation of tidal-dl-ng. That, or you've encountered some other odd error. I'll have to check that one out tomorrow.

I've also had a test running in an existing environment with quite the backlog, which has surfaced another potentially upstream issue. For some reason, it'll be deauthed every few hours. I think that's either a tidal-dl-ng issue or Tidal not liking it downloading so much in a relatively short time period.

@tinstep
Copy link

tinstep commented Jan 29, 2026

I manually went through your github and found all the new files and wget-ed then into my install. Probably needs another test from someone more experienced than I to confirm.

@samhaswon
Copy link
Author

So it worked for you? It might have just needed something updated to a newer version, and that happened to fix it.

@samhaswon
Copy link
Author

samhaswon commented Jan 30, 2026

Well, new issue. tidal-dl-ng got taken down on PyPi as well. My Lidarr container updated again, and broke when it couldn't pull it. Looks like this might need to be converted to use one of the forks of tidal-dl-ng.

@tinstep
Copy link

tinstep commented Jan 30, 2026

Sorry for delay, no it didn't work for me. I manually pulled in your files and that may have created the error. Might need someone more proficient than I to troubleshoot

@samhaswon samhaswon marked this pull request as draft January 30, 2026 23:44
@samhaswon
Copy link
Author

I'm just going to mark this as a draft for now until I can figure out a solution for tidal-dl-ng disappearing from PyPi. There are still the forks of it out there, but I'd like to take the time to check them out first.

@samhaswon samhaswon marked this pull request as ready for review February 11, 2026 02:26
@samhaswon
Copy link
Author

Finally got some more time to work on this. I ran into another issue mentioned in #369, so I fixed that too.

Also, to make testing easier, I pointed the setup script to my repo in 29c1b86, so that will need to be reverted before merging.

@mkaltner
Copy link

mkaltner commented Feb 12, 2026

Finally got some more time to work on this. I ran into another issue mentioned in #369, so I fixed that too.

Also, to make testing easier, I pointed the setup script to my repo in 29c1b86, so that will need to be reverted before merging.

See my PR's:

403 - Fix llvmlite build failure in Lidarr extended setup
404 - Add automatic API version detection for Arr apps

@steve1977
Copy link

Have you seen the development of arr-scripts V2? It is excellent and works well. Fixes some of the issues and has ported tidal-dl-ng for videos. https://github.com/RandomNinjaAtk/arr-scripts-v2

It may benefit from your fixes though. Maybe you @samhaswon can have a look and send PR?

  1. [Lidarr-MusicVideoAutomator.bash] relies on PyPi and needs to be fixed to one of the ports

  2. [Lidarr-MusicAutomator.bash] so far is Deezer only. Maybe a [Lidarr-MusicAutomator-Tidal.bash] could be added based on your work here?

@samhaswon
Copy link
Author

I hadn't seen that. Kind of irrelevant to me at the moment, as it doesn't support Tidal for music, so adding that support could help. I could look into integrating it, but what I've done here is mostly find and replace.

Now, what this could be is a good opportunity to restart my work with YouTube and Lidarr. I had worked on a script in Python for doing something like this, but I tuned it better for mixed English and other language titles.

@steve1977
Copy link

Cool! Musicvideos were working and should probably again with a simple change.

No clue how much effort it takes to add Tidal-Music to V2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - Lidarr - Tidal downloads broken

4 participants